// 引入的axios已经配置好基准路径
// import axios from "axios";
import axios from '@/utils/myaxios';
// 登录封装
export const loginuser = (data) => {
  return axios({
    url: '/login',
    method: 'post',
    data
  })
}
// 注册封装
export const registeruser = (data) => {
  return axios({
    url: '/register',
    method: 'post',
    data
  })
}

// 获取当前用户详情
export const edit_profile = (id) => {
  return axios({
    // 一定要注意，参数是路由参数
    url: `/user/${id}`
  })
}

// 编辑用户信息
export const updateUserInfo = function (id, data) {
  return axios({
    method: 'post',
    url: '/user_update/' + id,
    data
  })
}

//关注
export const userFollows = function (id) {
  return axios({
    url: '/user_follows/' + id,

  })
}

// 取消关注
export const useUnfollows = function (id) {
  return axios({
    url: '/user_unfollow/' + id
  })

}

//用户关注列表
export const followsList = function () {
  return axios({
    url: '/user_follows'
  })
}

// 收藏文章列表
export const userSatr = function () {
  return axios({
    url: '/user_star'
  })

}